cmake_minimum_required(VERSION 2.8)
add_compile_options(-std=c++11 -O3 -fPIC -DCPU_ONLY -march=armv8-a -DENABLE_NEON=ON -fstack-protector-all -Wl,-z,relro,-z,noexecstack)
project(MediaCodec)

# ddk
find_package(DDK REQUIRED)
include_directories(${DDK_INCLUDE_DIRS} ${DDK_CEREAL_INCLUDE_DIRS} ${DDK_PROTOBUF_INCLUDE_DIRS} ${DDK_OPENCV_INCLUDE_DIRS})

# common
include_directories(../common/)

# build for device
# vdec_engine
aux_source_directory(vdec_engine vdec_engine_src)
add_library(vdec_engine SHARED ${vdec_engine_src} ../common/trans_data.cpp)
#add_library(vdec_engine SHARED ${vdec_engine_src})
target_include_directories(vdec_engine PUBLIC vdec_engine)
target_link_libraries(vdec_engine ${DDK_DEVICE_LIBRARIES})


# venc_engine
aux_source_directory(venc_engine venc_engine_src)
add_library(venc_engine SHARED ${venc_engine_src})
target_include_directories(venc_engine PUBLIC venc_engine)
target_link_libraries(venc_engine ${DDK_DEVICE_LIBRARIES})
